﻿<script type="text/template" id="receive-doc-form-template">
<div id="receive-doc-form-error" class="error" style="margin-bottom: 10px;"></div>
<form id="receive-doc-form" onsubmit="return false;">
    <ul>
        <li>
            <%= jsResources.lang.DocInboxBook %>
            <select id="BookId" name="BookId" min="0">
                <%= VH.MakeOption(VOFFICE.DocInbox.BookReceiveList, model.BookId) %>
            </select>
        </li>
        <li>
            <%= jsResources.lang.DocInboxCode %>
            <input type="text" id="Code" name = "Code" value = "<%= model.Code %>" readonly="readonly" />
        </li>
        <li>
            <%= jsResources.lang.DocInboxCurrentNumber %>
            <input type="text" id="CurrentNumber" name = "CurrentNumber" value = "<%= model.CurrentNumber %>" readonly="readonly" />
        </li>
        <li>
            <%= jsResources.lang.DocInboxPaperCode %>
            <input type="text" id="PaperCode" name = "PaperCode" value = "<%= model.PaperCode %>" />
        </li>
        <li>
            <%= jsResources.lang.DocInboxAbstract %>
            <textarea name="Abstract" id="Abstract" required><%= model.Abstract %></textarea>  
            <%= jsResources.lang.DocInboxIsPackage %>
            <input type="checkbox" id="IsPackage" Name="IsPackage" <%= model.IsPackage == true ? 'checked="checked"' : '' %> />
        </li>
        <li>
            <%= jsResources.lang.DocInboxSignDate %>
            <input type="text"  name="SignDate" id="SignDate" value="<%= model.SignDate%>" class="input-date"/>
            <%= jsResources.lang.DocInboxSignName %>
            <input type="text" name="SignName" id="SignName" value="<%= model.SignName %>" />
        </li>
        <li>
            <%= jsResources.lang.DocInboxDocDate %>
            <input type="text" name="DocDate" id="DocDate" value = "<%= model.DocDate %>" class="input-date" />
        </li>
        <li>
            <%= jsResources.lang.DocInboxDocType %>
            <select id="DocTypeId" name="DocTypeId">
                <%= VH.MakeOption(VOFFICE.DocInbox.DocTypeList, model.DocTypeId) %>
            </select>
        
            <%= jsResources.lang.DocInboxDocPriority %>
            <select id="Priority" name="Priority">
                <%= VH.MakeOption(VOFFICE.DocInbox.DocPriorityList, model.Priority) %>
            </select>
            <%= jsResources.lang.DocInboxSecurity %>
            <select id="Security" name = "Security">
                <%= VH.MakeOption(VOFFICE.DocInbox.DocSecurityList, model.Security) %>  
            </select>
            <%= jsResources.lang.DocInboxReceivedType %>
            <select id="ReceivedType" name="ReceivedType">
                <%= VH.MakeOption(VOFFICE.DocInbox.DocReceivedTypeList, model.ReceivedType) %>
            </select>
        </li>
        <li>
            <%= jsResources.lang.DocInboxOfficeParter %>
            <% if( model.OfficePartnerList.length > 0 ) {%>
                <ul class="list-removable-item">
                    <% for( var i = 0; i < model.OfficePartnerList.length; i++ ) { %>
                        <li class="removable-item remove-op">
                            <%= model.OfficePartnerList[i].Value %>
                        </li>    
                    <% } %>
                </ul>
            <% } %>
            <a href="javascript:void(0)" id="show-office-partner"> <%= jsResources.lang.DocInboxOfficeParterChoose %></a>
        </li>
        <li>
            <%= jsResources.lang.DocInboxNumberOfDoc %>
            <input type="text" id="NumberOfDoc" name="NumberOfDoc" value="<%= model.NumberOfDoc %>"/>
            <%= jsResources.lang.DocInboxPageOfDoc %>
            <input type="text" id="PageOfDoc" name="PageOfDoc" value = "<%= model.PageOfDoc %>"/>
        </li>
        <li>
            <%= jsResources.lang.DocInboxIsReply %>
            <input type="checkbox" id="IsReply" name="IsReply" <%= model.IsReply == true ? 'checked="checked"' : '' %> />
            <span id="show-reply-details" style="display:none">
                <%= jsResources.lang.DocInboxIsReplyOf %>
                <input type="text" id="ReplyDocCode" name="ReplyDocCode" value = "<%= model.ReplyDocCode%>"/>
                <a href = "javascript:void(0)" class = "show-doc-publish"><%= jsResources.lang.DocInboxDocPublishChoose %></a>
            </span>
        </li>
        <li>
            <%= jsResources.lang.DocInboxFlowId %>
            <select id="FlowId" name = "FlowId" >
                <%= VH.MakeOption(VOFFICE.DocInbox.FlowList, null) %>
            </select>
            <a href = "javascript:void(0)" class = "show-flow-details"><%= jsResources.lang.DocInboxFlowDetails %></a>
        </li>
        <li>
            <% if( model.UploadedFiles.length > 0 ) {%>
                <ul class="list-removable-item" style="display:inline">
                    <% for(var i = 0; i < model.UploadedFiles.length; i++){ %>
                        <li class = "remove-upload-file removable-item" data-id = "<%= model.UploadedFiles[i].Key %>">
                            <%=  model.UploadedFiles[i].Value %>
                        </li>
                    <% } %>
                </ul>
            <% } %>
            <div class="clear"></div>
            <div id="qq-upload"/>
        </li>
    </ul>
    <input type="button" value="<%= jsResources.lang.DocInboxBack %>" id="submit-and-back"
    class="ui-button ui-widget ui-state-default ui-corner-all ui-state-hover" role="button" aria-disabled="false"/>
    <input type="button" value="<%= jsResources.lang.DocInboxStay %>" id="submit-and-stay"
    class="ui-button ui-widget ui-state-default ui-corner-all ui-state-hover" role="button" aria-disabled="false"/>
    <input type="button" value="<%= jsResources.lang.DocInboxCopy %>" id="submit-and-copy"
    class="ui-button ui-widget ui-state-default ui-corner-all ui-state-hover" role="button" aria-disabled="false"/>
</form>
</script>
